﻿using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Markup;
using YArchitech.LIB;
using YJKMenuAssist.Utility;

namespace YJKMenuAssist
{
	public partial class ExportForm : Window
	{
		public ExportForm()
		{
			this.InitializeComponent();
		}

		private void button_Click(object sender, RoutedEventArgs e)
		{
			FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
			folderBrowserDialog.Description = "请选择文件夹";
			if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
			{
				if (string.IsNullOrEmpty(folderBrowserDialog.SelectedPath))
				{
					System.Windows.MessageBox.Show(this, "文件夹路径不能为空", "提示");
					return;
				}
				this.textBox.Text = folderBrowserDialog.SelectedPath;
			}
		}

		private void Window_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
		{
			if (e.Key == Key.Escape)
			{
				base.DialogResult = new bool?(false);
			}
		}

		private void btnOK_Click(object sender, RoutedEventArgs e)
		{
			base.DialogResult = new bool?(true);
		}

		private void btnCanel_Click(object sender, RoutedEventArgs e)
		{
			base.DialogResult = new bool?(false);
		}

		private void Window_Loaded(object sender, RoutedEventArgs e)
		{
			base.Icon = Common.ToImageSource(YArchitech.LIB.Resources.YArchitech);
		}
	}
}
